<%@page import="common.Var"%>
<%@page import="com.ks.entity.User"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Welcome Page</title>
</head>
<body>
	<c:choose>
		<c:when test="${sessionScope[Var.USER_INFO]==null}">
			<a href="${pageContext.request.contextPath}/jsp/login.jsp">登录</a>
			<br />
		</c:when>
		<c:otherwise>
			<h1>
				欢迎你，
				<%-- ${param.username} --%>
				${sessionScope[Var.USER_INFO].username}
				<%-- <%=request.getParameter("username")%> --%>
			</h1>
		</c:otherwise>
	</c:choose>
	<hr />
	<h3>已经登录用户列表(session存在用户信息)</h3>
	<br />
	<c:forEach var="user" items="${applicationScope[Var.ACCESS_USERS]}">
		<%--     ${user.value} --%>
    ${user.key} (${user.value})|
    </c:forEach>
	<hr />
	<h3>
		总访问人数:${applicationScope[Var.TOTAL_COUNT]}!<br>
		<%-- <%=application.getAttribute(Var.TOTAL_COUNT)%>位访问者!<br />  --%>
		当前在线访问人数(session存在)：${applicationScope[Var.ACCESS_COUNT]}<br />
	</h3>
	<h3>
		<a href="<%=response.encodeURL("/userServlet?method=showUser")%>">查看个人信息(进行URL重写,Cookie禁用时使用)</a>
		<br /> <a href="/userServlet?method=showUser">查看个人信息</a> <br /> <a
			href="/userServlet?method=showAllUser">查看所有用户</a><br /> <a
			href="/logout">退出登录</a>
	</h3>
</body>
</html>